<!--<link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css" media="all">-->
<link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.css">
<link rel="stylesheet" type="text/css" href="__CSS__/bootstrap-select.min.css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin.css">
<link rel="stylesheet" type="text/css" href="__CSS__/lc_switch.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/jquery-ui/jquery-ui.css">
<!--<link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css">-->
<link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css">
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.form.js"></script>
<script type="text/javascript" src="__STATIC__/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/common.js"></script>
<script type="text/javascript" src="__STATIC__/js/lc_switch.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer/layer.js">
</script>
<script type="text/javascript" src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/tinymce/tinymce.min.js"></script>
<meta charset="UTF-8">
<div class="admin-top">
    <ul class="layui-nav nav-top">
        <li class="layui-nav-item">
            <a href="">后台管理系统</a>
        </li>
        <li class="layui-nav-item"></li>
        <li class="layui-nav-item  personinfo" lay-unselect="">
            <a href="javascript:;"><img src="#" class="layui-nav-img">我</a>
            <dl class="layui-nav-child">
                <dd><a href="admin/index/webConfig">修改信息</a></dd>
                <dd><a href="{:Url('Admin/login/loginout')}">退出登录</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item homepage">
            <a href="{:Url('Index/index/index')}">网站首页</a>
        </li>
    </ul>
</div>
    <div class="leftsider">
        <ul class="layui-nav layui-nav-tree layui-inline " id="nav-left" style="margin-right: 10px;">
            <li class="layui-nav-item layui-nav-itemed " id="iconfontnav"><a><i class="iconfont">&#xe504;</i></a><a><i
                    class="iconfont">&#xe6e7;</i></a></li>
            {foreach name="menulist" item="menulist"}
            <li class="layui-nav-item layui-nav-itemed menunav">
                <a href="javascript:;">
                    <i class="iconfont">{$menulist.icon}</i>
                    <span class="nav-text">{$menulist.text}</span>
                    &nbsp;</a>
                <dl class="layui-nav-child">
                    {foreach name="menulist.submenu" item="submenu"}
                    <dd {if condition="$submenu.name eq $cursubmenu" } class="ddactive"
                        {/if}>
                    <a href="{$submenu.url}">
                        <i class="iconfont">{$submenu.icon}</i>
                        <span class="nav-text"> {$submenu.text}</span>
                        {if condition="($notreadcm>0)"}
                            {if condition="($submenu.name=='dynamic')"}
                            <span class="dynamic-nav">{$notreadcm}</span>
                            {/if}
                        {/if}
                    </a>
                    </dd>
                    {/foreach}
                </dl>
            </li>
            {/foreach}

        </ul>

    </div>
<div class="content-parent">
    <div></div>
    <div class="content">
        {block name="content"}{/block}
    </div>

</div>

<script>
    var iconfontnav = document.getElementById('iconfontnav');
    var navleft = document.getElementById('nav-left');
    var content = document.getElementsByClassName("content");
    var status = 1;
   var docWidth=$(document).width();
   // $('.content').css('width',(docWidth-200)+'px');
   // console.log(docWidth);
    // $('.admin-left-main').css('width',docWidth+'px')
    iconfontnav.onclick = function () {
        // alert(status);
        var navtext = document.getElementsByClassName('nav-text');
        var iconfontnavchild = iconfontnav.childNodes;
        if (status == 1) {
            for (var i = 0; i < navtext.length; i++) {
                // navtext[i].parentNode.removeChild(navtext[i]);
                navtext[i].style.display = "none";
                // alert(navtext[i].innerHTML)
            }
            iconfontnav.childNodes[0].style.display = 'none';
            iconfontnav.childNodes[1].style.display = 'block';
            // alert(iconfontnavchild.length)
            navleft.classList.add('nav-sider');
            // $('.content').css('width','90%')
            $('.leftsider').css('width','70px');
            $('.content-parent > div:first-child').css('width','70px');
            status = 0;
        }
        else if (status == 0) {
            for (var i = 0; i < navtext.length; i++) {
                // navtext[i].parentNode.removeChild(navtext[i]);
                navtext[i].style.display = "inline-block";
                // i--;
                // alert(navtext[i].innerHTML)
                $('.leftsider').css('width','200px')
                $('.content-parent > div:first-child').css('width','200px');
            }
            iconfontnav.childNodes[1].style.display = 'none'
            iconfontnav.childNodes[0].style.display = 'block';
            navleft.classList.remove('nav-sider');
            status = 1;
        }
    };


    layui.use('element', function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        //监听导航点击
        element.on('nav(demo)', function (elem) {
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>

<script>

</script>

